Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

@ivaylo-matov ivaylo-matov commented Jan 27, 2026

Purpose

This PR addresses DYN-9357

It improves clarity in the Search tab so users can easily see which version of a package is currently installed:

  • the version dropdown now defaults to the installed version.
  • the installed version in the dropdown is labeled with an “(installed)” suffix.
  • a badge is shown when a newer version of the package is available.
  • the Install button now:
    • displays “Update” when a different version is available.
    • displays “Uninstall” when the installed version is selected.

Changes in code:

  • install state tracking in the search element view model (installed version, selected version, update availability).
  • InstallActionText / InstallActionCommand so the button label and action change based on state.
  • fallback “Installed” state when uninstall isn’t possible.
  • added a null guard when downloading a selected version to avoid crashes.

DYN-9357

Declarations

Check these if you believe they are true

Release Notes

Changes improves clarity in the Search tab so users can easily see which version of a package is currently installed.

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@emru-y
@dnenov

Copilot AI review requested due to automatic review settings January 27, 2026 07:14
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9357

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Package Manager Search tab by enhancing visibility of installed package versions and their update status. The changes allow users to see which package version is currently installed, whether updates are available, and provide contextual install/update/uninstall actions.

Changes:

  • Added tracking for installed package versions and update availability in the search element view model
  • Modified the install button to dynamically display "Install", "Update", or "Uninstall" based on the package state
  • Added visual indicators (badges and labels) to show installed versions and available updates
  • Added null guards to prevent crashes when downloading selected versions

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
PackageManagerSearchElement.cs Added IsInstalled property to VersionInformation to track installed package versions
PackageManagerPackagesControl.xaml Updated UI to display "(installed)" label in version dropdown and "New version available" badge; modified install button binding to use new command and text properties
PackageManagerSearchViewModel.cs Added methods to track install state, handle uninstall operations, and update UI based on package installation status
PackageManagerSearchElementViewModel.cs Added properties and commands to manage install/uninstall actions and track installation state; added null guards in download logic
PublicAPI.Unshipped.txt Documented new public API members for install state tracking and action properties
Resources.resx Added localization strings for "Update", "Uninstall", and "New version available"
Resources.en-US.resx Added English localization strings matching Resources.resx additions
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported

@zeusongit
Copy link
Contributor

The second popup, after you click on +Update appears on left side of the screen, can we fix that to appear in the center like other popups?


this.DownloadLatestCommand = new DelegateCommand(
() => OnRequestDownload(false),
() => !SearchElementModel.IsDeprecated && CanInstall);
Copy link
Contributor

@zeusongit zeusongit Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we removing CanInstall from this check?
Asking as that may lead to unexpected change somewhere where this may be expected

Text="{Binding Version}" />
<TextBlock VerticalAlignment="Center"
Foreground="White"
Text=" (installed)">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be localized

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also check if the width of the dropdown will cause any overflows, as in some languages "installed" may be longer than english

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I have now added a resource.
The dropdown will expand if the string is longer.
Screenshot 2026-01-28 073014

@zeusongit
Copy link
Contributor

I am unsure after this change which property can we depend upon for a true value of CanInstall answer globally i.e Which property can tell us if a package version is install-able.

@ivaylo-matov
Copy link
Contributor Author

The second popup, after you click on +Update appears on left side of the screen, can we fix that to appear in the center like other popups?

CanInstall is set to false whenever any version of the package is already installed (see UpdateInstallState).
When a package is installed and the user selects a different version, the action becomes Update and if the DownloadLatestCommand was still reliant on CanInstall the button would be disabled for every installed package.
The availability of the command is still controlled by IsEnabledForInstall

@ivaylo-matov
Copy link
Contributor Author

I am unsure after this change which property can we depend upon for a true value of CanInstall answer globally i.e Which property can tell us if a package version is install-able.

In this context, there isn't a single global installable flag because the actions now depends on the selected version of the package and the current state (installed | update | uninstall).
CanInstall still means that there are no local packages with the same name _ nothin blocking the download, so it is not the right check for update.
For install action we now rely on :

  • IsEnabledForInstall - custom package locations disabled/enabled
  • !Isdepreciated
  • IsInstalledVersionSelected + `hasInstalledVersion - drives install | update | uninstall
  • IsSelectedVersionComaptible - only drives warning and doesn't block anything

If this is still confusing, maybe I can rename properties like CanExecuteInstallAction or update the comments? Maybe I can add a comment to note that states the intest shifts away from CanInstall?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants